import Rectangle from './Rectangle.js';

const landDom = document.querySelector('.land');
const landDomStyle = getComputedStyle(landDom);
const landWidth = parseInt(landDomStyle.width);
const landHeight = parseInt(landDomStyle.height);
const landTop = parseInt(landDomStyle.top);

export default class Land extends Rectangle {
  constructor() {
    super(0, landTop, landWidth, landHeight, -100, 0, landDom);
  }

  onMove() {
    if (this.left <= -landWidth / 2) {
      this.left = 0;
    }
  }
}
